//
//  Currencies.swift
//  Wallet
//
//  Created by Julian on 2022/5/7.
//

import Foundation

/// 用户所有币种
struct CurrencyInfo: Codable {
    let currencies: [Coin]
    
    /// 空情况
    static let empty = CurrencyInfo(currencies: [])
}

/// 币信息
struct Coin: Codable {
    let coinID: String
    let name: String
    let symbol: String
    let amount: Double
    // 该币兑换 (USD | UKD) 汇率
    var rates: Tiers?
    
    /// key 映射
    enum CodingKeys: String, CodingKey {
        case coinID = "coin_id"
        case name
        case symbol
        case amount
        case rates
    }
}
